const mysql = require("mysql");
const conn = mysql.createConnection({
    host: "localhost",
    port: 3306,
    user: "root",
    password: "root",
    database: "user",
});
conn.connect();
let sql = "update student set ? where id=?";
let obj = { name: "张山", age: 20, sex: "男" };
conn.query(sql, [obj, 4], (err, result) => {
    if (err) return console.log(err);
    console.log(result);
});
conn.end();